interface Count {
  number: number
}
interface Action {
  type: string
  [propName:string]: any
}

const init2:Count = {
  number: 0
}

export default (state = init2, action:Action) => {
  switch (action.type) {
      case 'addCount2':
          return {...state,number : state.number+1}
      case 'reduceCount2':
          return {...state,number : action.count-1}
      default:
          return state
  }
}
